package com.kbs.adapter;

import java.util.ArrayList;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.kbs.lazy.ImageLoader;

public class ImageAdapter extends BaseAdapter {
	private Context mContext;
	private ArrayList<String> mListImage;
	private ImageLoader mImageLoader;

	public ImageAdapter(Context context, ArrayList<String> listImage) {
		mContext = context;
		mListImage = listImage;
		mImageLoader = new ImageLoader(mContext);
	}

	@Override
	public int getCount() {
		return mListImage.size();
	}

	@Override
	public String getItem(int index) {
		return mListImage.get(index);
	}

	@Override
	public long getItemId(int index) {
		return index;
	}

	@Override
	public View getView(int index, View arg1, ViewGroup arg2) {
		ImageView iv = new ImageView(mContext);
//		iv.setImageResource(R.drawable.ic_launcher);
		mImageLoader.DisplayImage(mListImage.get(index), iv);
		return iv;
	}

}
